(global.webpackJsonp = global.webpackJsonp || []).push([ [ "pages/member/coupon/coupon" ], {
    1061: function(e, t, o) {
        o.r(t);
        var n = o("30f2"), i = o.n(n);
        for (var u in n) "default" !== u && function(e) {
            o.d(t, e, function() {
                return n[e];
            });
        }(u);
        t.default = i.a;
    },
    1483: function(e, t, o) {
        o.r(t);
        var n = o("a543"), i = o("1061");
        for (var u in i) "default" !== u && function(e) {
            o.d(t, e, function() {
                return i[e];
            });
        }(u);
        o("5ed1");
        var c = o("f0c5"), a = Object(c.a)(i.default, n.b, n.c, !1, null, "976a9518", null, !1, n.a, void 0);
        t.default = a.exports;
    },
    "2a38": function(e, t, o) {
        (function(e) {
            o("98af"), n(o("66fd"));
            var t = n(o("1483"));
            function n(e) {
                return e && e.__esModule ? e : {
                    default: e
                };
            }
            wx.__webpack_require_UNI_MP_PLUGIN__ = o, e(t.default);
        }).call(this, o("543d").createPage);
    },
    "30f2": function(e, t, o) {
        (function(e) {
            Object.defineProperty(t, "__esModule", {
                value: !0
            }), t.default = void 0;
            var n = {
                mixins: [ o("ebe2").checkLogin ],
                data: function() {
                    return {
                        express_code: "",
                        couponRules: "",
                        couponStatus: 1,
                        type: 1,
                        dataSource: [],
                        activeCoupon: "",
                        activeCouponIndex: "",
                        title: "亲，您暂时还没有可用的优惠券哦~",
                        pay_money: 0
                    };
                },
                components: {
                    empty: function() {
                        o.e("components/empty/empty").then(function() {
                            return resolve(o("6234"));
                        }.bind(null, o)).catch(o.oe);
                    },
                    wybPopup: function() {
                        o.e("components/wyb-popup/wyb-popup").then(function() {
                            return resolve(o("1306"));
                        }.bind(null, o)).catch(o.oe);
                    }
                },
                methods: {
                    close_rule: function() {
                        this.$refs.popup.hide();
                    },
                    showRule: function(e) {
                        this.couponRules = e.ruletext, this.$refs.popup.show();
                    },
                    confirm: function() {
                        var t, o = this;
                        t = "" !== this.activeCoupon ? this.dataSource.find(function(e) {
                            return e.id === o.activeCoupon;
                        }) : this.activeCoupon, this.$api.isUseCouponApi({
                            user_id: this.$db.get("userId"),
                            promotion_id: t.promotion_id,
                            pay_money: this.pay_money
                        }, function(n) {
                            "1" == n.code ? (o.$db.set("activeCoupon", t), o.$db.set("activeCouponIndex", o.activeCouponIndex), 
                            e.navigateBack()) : o.$common.errorToShow(n.msg);
                        });
                    },
                    changeType: function(e) {
                        this.type !== e && (this.type = e, this.activeCoupon = "", this.dataSource = [], 
                        this.loadRes());
                    },
                    select: function(t, o) {
                        2 != this.type && "1" != o.no_sati && (this.dataSource[t].checked1 = !this.dataSource[t].checked, 
                        this.dataSource[t].checked1 ? (this.activeCouponIndex = t, this.activeCoupon = this.dataSource[t].id, 
                        this.dataSource[t].checked = !0, "1" == this.couponStatus && e.reLaunch({
                            url: "/pages/delivery/delivery"
                        })) : (this.activeCouponIndex = "", this.activeCoupon = "", this.dataSource[t].checked = !1));
                    },
                    loadRes: function() {
                        var e = this;
                        this.$api.myCouponApi({
                            type: this.type,
                            page: 1,
                            limit: 1e3,
                            express_code: this.express_code,
                            pay_money: this.pay_money
                        }, function(t) {
                            if ("1" == t.code) {
                                var o = (t.data || {}).list, n = void 0 === o ? [] : o, i = e;
                                n.forEach(function(e, t) {
                                    t === i.activeCouponIndex ? i.$set(e, "checked", !0) : i.$set(e, "checked", !1);
                                }), i.dataSource = n;
                            } else e.$common.errorToShow(t.msg);
                        });
                    },
                    autoGetGGHHb: function() {
                        var t = this;
                        this.$db.get("gghhb") ? this.$api.autoGetGGHHbApi({
                            user_id: this.$db.get("userId")
                        }, function(o) {
                            if ("1" != o.code) return t.$common.errorToShow(o.msg), void ("9937" == o.code && (t.$db.del("gghhb"), 
                            setTimeout(function() {
                                e.reLaunch({
                                    url: "/subpages/pages/official-account/official-account"
                                });
                            }, 3e3)));
                            t.$db.del("gghhb"), t.loadRes();
                        }) : this.loadRes();
                    }
                },
                onLoad: function(t) {
                    console.log("options", t);
                    var o = (t || {}).status, n = void 0 === o ? 1 : o;
                    this.couponStatus = Number(n || 1), t.pay_money && (this.pay_money = t.pay_money), 
                    t.express_code && (this.express_code = t.express_code), this.loadRes(), e.setNavigationBarTitle({
                        title: 1 === this.couponStatus ? "我的优惠券" : "选择优惠券"
                    }), this.activeCoupon = this.$db.get("activeCoupon") ? this.$db.get("activeCoupon").id : "";
                },
                onShow: function() {
                    0 === this.couponStatus && (this.activeCoupon = this.$db.get("activeCoupon") ? this.$db.get("activeCoupon").id : "", 
                    this.activeCouponIndex = "" !== this.$db.get("activeCouponIndex") ? this.$db.get("activeCouponIndex") : "");
                }
            };
            t.default = n;
        }).call(this, o("543d").default);
    },
    "3f35": function(e, t, o) {},
    "5ed1": function(e, t, o) {
        var n = o("3f35");
        o.n(n).a;
    },
    a543: function(e, t, o) {
        o.d(t, "b", function() {
            return i;
        }), o.d(t, "c", function() {
            return u;
        }), o.d(t, "a", function() {
            return n;
        });
        var n = {
            empty: function() {
                return o.e("components/empty/empty").then(o.bind(null, "6234"));
            },
            wybPopup: function() {
                return o.e("components/wyb-popup/wyb-popup").then(o.bind(null, "1306"));
            }
        }, i = function() {
            this.$createElement, this._self._c;
        }, u = [];
    }
}, [ [ "2a38", "common/runtime", "common/vendor" ] ] ]);